package com.soilflow.info.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.soilflow.common.domain.LandRent;
import com.soilflow.common.domain.SysConsultation;
import com.soilflow.common.utils.DateUtils;
import com.soilflow.info.mapper.LandRentMapper;
import com.soilflow.info.mapper.SysConsultationMapper;
import com.soilflow.info.service.ISysConsultationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 通知公告Service业务层处理
 * 
 * @author party
 * @date 2023-09-15
 */
@Service
public class SysConsultationServiceImpl extends ServiceImpl<SysConsultationMapper, SysConsultation> implements ISysConsultationService {
    @Autowired
    private SysConsultationMapper sysConsultationMapper;

    /**
     * 查询通知公告
     * 
     * @param noticeId 通知公告主键
     * @return 通知公告
     */
    @Override
    public SysConsultation selectSysConsultationByNoticeId(Long noticeId)
    {
        return sysConsultationMapper.selectSysConsultationByNoticeId(noticeId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param sysConsultation 通知公告
     * @return 通知公告
     */
    @Override
    public List<SysConsultation> selectSysConsultationList(SysConsultation sysConsultation)
    {
        return sysConsultationMapper.selectSysConsultationList(sysConsultation);
    }

    /**
     * 新增通知公告
     * 
     * @param sysConsultation 通知公告
     * @return 结果
     */
    @Override
    public int insertSysConsultation(SysConsultation sysConsultation)
    {
        sysConsultation.setCreateTime(DateUtils.getNowDate());
        return sysConsultationMapper.insertSysConsultation(sysConsultation);
    }

    /**
     * 修改通知公告
     * 
     * @param sysConsultation 通知公告
     * @return 结果
     */
    @Override
    public int updateSysConsultation(SysConsultation sysConsultation)
    {
        sysConsultation.setUpdateTime(DateUtils.getNowDate());
        return sysConsultationMapper.updateSysConsultation(sysConsultation);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSysConsultationByNoticeIds(Long[] noticeIds)
    {
        return sysConsultationMapper.deleteSysConsultationByNoticeIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeId 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSysConsultationByNoticeId(Long noticeId)
    {
        return sysConsultationMapper.deleteSysConsultationByNoticeId(noticeId);
    }

    @Override
    public int updatestatus(Long id,String status) {
        return sysConsultationMapper.updatestatus(id,status);
    }
}
